<?php
namespace app\controller;

use app\service\DepartmentService;
use support\Request;
use support\Response;

class DepartmentController
{
    /**
     * @var DepartmentService
     */
    private $departmentService;

    public function __construct()
    {
        $this->departmentService = DepartmentService::getInstance();
    }

    /**
     * 校验部门是否可删除
     * @param Request $request
     * @return Response
     */
    public function deleteCheck(Request $request): Response
    {
        $param = $request->post();
        $res = $this->departmentService->deleteCheck($param);
        return json(success_response('', $res));
    }
}